var async=require('async');
var mock=require('./mock.js');

async.waterfall([
		(cb)=>{
			setTimeout(()=>{
				console.log(1);
				cb();
			},500);
		},
		(cb)=>{
			setTimeout(()=>{
				console.log(2);
				async.map([1,2,3,4,5,6,7,8,9],(n,mcb)=>{
					
					setTimeout((n)=>{
						console.log('m:'+n);
						var err=0==n%2?'==0':null,post=err?null:'POST-'+n;
					
						//if(err)return mcb(err);								
						
						mcb(null,post);													
						

					},200,n);	

				},(err,list)=>{
					if(err)return cb(err);
					cb(null,list);
				});
				
			},500);
		}
	],(err,ret)=>{
    	console.log('err:',err);
    	console.log('ret:',ret);
});